uQuery compare Property value with all sting[] list items
Im trying to get a node by type where one or more categories is choosen on the node. This method is used by calling the api from ajax.
public IList<object> getAllFromCriteria(string categories)
{
List<object> resultList = new List<object>();
try
{
string[] categoryList = categories.Split(',');
List<umbraco.NodeFactory.Node> nodes = uQuery.GetNodesByType("TYPE").Where(x => categoryList.Any(x.GetProperty("PROPERTYALIAS").Value.ToString().Contains)).ToList();
InServiceFunctions isFunc = new InServiceFunctions();
resultList = isFunc.MakeListWithObject(nodes);
}
catch (Exception e)
{
object error = new { error = e };
resultList.Add(error);
}
return resultList;
}
This always return an error at the line where i try to get the nodes.
I have tryed alot of diffrend things here but can't find a solution does anyone know a way to check if string[] list items contains in node property value.
And the property is populated with a Umbraco.MultiNodeTreePicker if this make any different
uQuery compare Property value with all sting[] list items
Im trying to get a node by type where one or more categories is choosen on the node. This method is used by calling the api from ajax.
This always return an error at the line where i try to get the nodes. I have tryed alot of diffrend things here but can't find a solution does anyone know a way to check if string[] list items contains in node property value.
And the property is populated with a Umbraco.MultiNodeTreePicker if this make any different
Hi Dan,
Ok so to confirm, you want to get a collection of nodes filtered by checking a multinode tree picker to see a certain node is within that picker?
And you are using Umbraco 7 MVC?
Jeavon
is working on a reply...